﻿using System.Windows;

namespace Labthink.PCSoft.UniversalHost4.UserControls.CustomControls
{
    public class MaximizeButton:CaptionButton
    {
        static MaximizeButton()
        {
            DefaultStyleKeyProperty.OverrideMetadata(typeof(MaximizeButton), new FrameworkPropertyMetadata(typeof(MaximizeButton)));
        }



        protected override void OnClick()
        {
            base.OnClick();
            var  w = Window.GetWindow(this);
            if (w == null) return;
            if (w.WindowState == WindowState.Maximized)
                SystemCommands.RestoreWindow(w);
            else
                SystemCommands.MaximizeWindow(w);
        }
    }
}
